<script type="text/javascript" src="<?php Yii::app()->request->baseUrl.'/assets/884ba3ad/gridview/jquery.yiigridview.js' ?>"></script>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/assets/760cf9c0/pager.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/assets/884ba3ad/gridview/styles.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />

<script type="text/javascript">
    function addUsuarioToInput(obj){
        if (obj != ''){
            var el = parent.document.getElementById('Alocacao_TX_INTERESSADO');
            el.value = obj;
            top.tb_remove();
        }
    }
</script>
    
<div class="search-form">
    <div class="wide form">
        <?php $form=$this->beginWidget('CActiveForm', array(
                'action'=>Yii::app()->createUrl($this->route),
                'method'=>'get',
        )); ?>
        <div class="row">
		<?php echo $form->label($model,'TX_NOME'); ?>
		<?php echo $form->textField($model,'TX_NOME',array('size'=>60,'maxlength'=>80)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'ID_PERFIL'); ?>
		<?php
                    $dados = array(-1=>'Selecione');
                    $dados += $model->getPerfis();
                    echo $form->dropDownList($model, 'ID_PERFIL', $dados);
                ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'TX_EMAIL'); ?>
		<?php echo $form->textField($model,'TX_EMAIL',array('size'=>50,'maxlength'=>50)); ?>
	</div>
        <div class="row buttons">
                <?php echo CHtml::submitButton('Pesquisar'); ?>
        </div>
        <?php $this->endWidget(); ?>
    </div><!-- search-form -->
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'disciplina-grid',
    'dataProvider'=>$model->search(),
    'columns'=>array(
        array(
            'class'=>'CButtonColumn',
            'template'=>'{select}',
            'buttons'=>array(
                'select' => array(
                    'label'=>'Selecionar',
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/plus.png',
                    'url'=>'"javascript:addUsuarioToInput(\"".$data->TX_NOME."\");"',
                )
            )
        ),
        'TX_NOME',
        'TX_EMAIL',
    ),
    'pager'=>array(
            'header'=>''
        )
)); ?>
